home *** CD-ROM | disk | FTP | other *** search
/ System Booster / System Booster.iso / Archives / ARexxTools / RCS_TTX.lha / RCSshowlog.ttx < prev   
Encoding:
Text File  |  1994-06-04  |  2.2 KB  |  75 lines

  1. /*************************************************************************
  2. * RCSshowlog.ttx:    Show the RCS change log in a buffer.
  3. * Author:        Daniel J. Barrett, barrett@cs.umass.edu
  4. * Distribution:        Copyright 1994 Daniel J. Barrett.
  5. *            This file is freely distributable provided it is
  6. *            distributed in its entirety.
  7. *
  8. * Version:        $VER: RCSshowlog 1.0 (04.06.94)
  9. * Version history:
  10. *    1.0 (04.06.94):    Initial release
  11. *************************************************************************/
  12.  
  13. OPTIONS RESULTS
  14.  
  15. /*************************************************************************
  16. * Get any RCS options.
  17. *************************************************************************/
  18.  
  19. PARSE ARG RCSoptions
  20.  
  21. /*************************************************************************
  22. * Open rexxsupport.library.
  23. *************************************************************************/
  24.  
  25. IF ~show('L', 'rexxsupport.library') THEN DO
  26.     IF ~addlib('rexxsupport.library', 0, -30, 0) THEN DO
  27.         SAY "Cannot open rexxsupport.library"
  28.         EXIT
  29.     END
  30. END
  31.  
  32. /*************************************************************************
  33. * Get the directory name and the filename.
  34. *************************************************************************/
  35.  
  36. GetFilePath
  37. IF RC ~= 0 THEN DO
  38.     CALL ReportError("Cannot locate this file's path")
  39.     EXIT 5
  40. END
  41. myfile    = FileOf(RESULT)
  42.  
  43.  
  44. /*************************************************************************
  45. * Open the log as a normal document.
  46. *************************************************************************/
  47.  
  48. LOGFILE = "t:" || myfile || "_LOG"
  49.  
  50. ADDRESS COMMAND "rlog" RCSoptions myfile ">" LOGFILE
  51. IF Word(statef(LOGFILE), 2) = 0 THEN
  52.     CALL TellUser("No log found.")
  53. ELSE DO
  54.     OpenDoc NAME LOGFILE
  55.     ADDRESS COMMAND "Delete" LOGFILE "FORCE"
  56. END
  57.  
  58.  
  59. EXIT
  60.  
  61. /*************************************************************************
  62. * Return a file's unqualified name, given the fully qualified name.
  63. * Return "" if there is none.
  64. *************************************************************************/
  65.  
  66. FileOf: PROCEDURE
  67.     PARSE ARG pathname
  68.     here = LastPos("/", pathname)
  69.     IF here = 0 THEN
  70.         here = LastPos(":", pathname)
  71.     IF here = 0 THEN
  72.         RETURN("")
  73.     ELSE
  74.         RETURN(SubStr(pathname, here+1))
  75.